package com.t235.gc.feign.goods;

import com.t235.gc.AjaxResult;
import com.t235.gc.vo.GoodsVo;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class GoodsRemoteClientFallbackFactory implements FallbackFactory<GoodsRemoteClient> {

    @Override
    public GoodsRemoteClient create(Throwable throwable) {
        log.info("进入回退");
        return new GoodsRemoteClient() {
            @Override
            public AjaxResult getBackDeviceCabinetList(GoodsVo goodsVo, Integer page, Integer limit) {
                return AjaxResult.error("用户微服务getBackDeviceCabinetList()正忙，请稍后访问");
            }
        };
    }
}
